Support higher performance bvar with babylon counter#3116
Merged
Conversation
b6b87af to
6fdda36
Compare
Contributor
Author
6fdda36 to
46392ac
Compare
Contributor
|
I think you can also update the document for this new feature. |
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR implements optional integration with Babylon counter library to improve bvar performance through high-performance, lock-free concurrent counters. When enabled with build flag --define with_babylon_counter=true, bvar operations can achieve significant performance improvements (e.g., latency_recorder improves from 132.36ns to 28.66ns).
- Adds conditional compilation support for Babylon counter integration throughout bvar components
- Updates test cases to handle behavior differences when using Babylon counters
- Modifies build configuration to support the new compilation option
Reviewed Changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| src/bvar/reducer.h | Implements BabylonVariable template and specializations for Adder, Maxer, Miner using Babylon counters |
| src/bvar/recorder.h | Adds Babylon counter-based IntRecorder implementation |
| src/bvar/detail/percentile.h | Implements Babylon counter-based Percentile class |
| src/bvar/detail/percentile.cpp | Adds Babylon counter-specific implementation for percentile operations |
| test/*.cpp | Updates test cases with conditional compilation for Babylon counter compatibility |
| BUILD.bazel | Adds build configuration and dependencies for Babylon counter support |
| .bazelrc | Updates build configuration with optimization flags |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
46392ac to
c0d0745
Compare
Contributor
Author
done |
Contributor
|
LGTM |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What problem does this PR solve?
Issue Number: resolve #2675
Problem Summary:
bvar::detail::AgentCombiner use LOCK or CAS operation as a general implementation for counter, but the LOCK or CAS operation may be avoidable.
What is changed and the side effects?
Changed:
Refer to Use concurrent counter optimize bvar to use babylon counter to implement bvar and improve bvar performance.
Use bvar with babylon(>= 1.4.4) counter through
bazel build --define with_babylon_counter=true //:brpc.Side effects:
Performance report from Use concurrent counter optimize bvar:
Check List: